﻿using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace Canteen.Core.Models
{
    public class BaseEntity : BaseEntity<int>, IBaseEntity
    {
    }
    public class BaseEntity<TPrimaryKey> : IBaseEntity<TPrimaryKey>
    {
        [Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)]
        public virtual TPrimaryKey Id { get; set; }

        [Column(TypeName = "DATETIME")]
        public virtual DateTime CreateTime { get; set; } //创建时间

        [Column(TypeName = "DATETIME")]
        public virtual DateTime? UpdateTime { get; set; }//更新时间
    }
}
